<script type="text/javascript">
$(document).ready(function() {
	prepareInputsForHints();


	$(".catCheck").click(function(){

		var img = '<img id="imgloadsetunsetcategory" alt="" src="/img/ajax-loader.gif"/>'; 
		
		jQuery(img).insertBefore('#categoryFeedProfile-'+$(this).val());

		var url = '';

		if(this.checked) {
		    url = '/category/setcategoryofinterest';
		} else {
			url = '/category/unsetcategoryofinterest';
		}

		executeRequest($(this).val(), url, function(data){
			if (data.error) {
	            jQuery.facebox(data.message);
	        }
	        $('#imgloadsetunsetcategory').remove();
		});
		
	});


	var profileOptions = {
       dataType: "json",    
       success: function(data) { 
            if (data.error == false) { 
            	jQuery.facebox("<?= $this->translate('okMsg') ?>");
            } else {
                jQuery.facebox(parseJsonValidation(data.messages));
            } 
        },
       error:   function (xhr, ajaxOptions, thrownError) {
            jQuery.facebox("<?= $this->translate('ajaxError') ?>");
       }
    };

    $('#userProfileForm').ajaxForm(profileOptions);

});
</script>


<!--###Blocco Centrale###-->
    <div id="content">
	    <form id="<?= $this->escape($this->formUserProfile->getAttrib("id"))?>"
	    	  action="<?= $this->escape($this->formUserProfile->getAction())?>" 
	    	  method="<?= $this->escape($this->formUserProfile->getMethod())?>">
		    <div id="centerLeft">
			    <div class="borderLeftWhite">
	            <? if($this->loadCategories): ?>
			    	<div id="categorypForm">
			    		<div class="tabs"><?= $this->translate('categories')?></div>
							<div id="scrollCategories">
								  
								<ul class="ulCategory">
								 <?= $this->formUserProfile->categoryFeedProfile?>
								</ul>
								
							</div>
							<p><span id="status"></span></p>
			    	</div>
			    <? endif ?>	
			    </div>
	    	</div>	    
	    	<div id="puForm">
	    		<div class="tabs"><?= $this->translate('userProfile')?></div>
	    		<ul class="ulForm">
	    			<li class="element-group">
						<?= $this->formUserProfile->openid_identifier ?>
					</li>
					<? if($this->loadpwd): ?>
					<li class="element-group">
						<?= $this->formUserProfile->password ?>
					</li>
					<li class="element-group">
						<?= $this->formUserProfile->confirmPassword ?>
					</li>
					<? endif ?>
	    			<li class="element-group">
						<?= $this->formUserProfile->nickname ?>
					</li>
					<li class="element-group">
						<?= $this->formUserProfile->fullname ?>
					</li>
		    		<li class="element-group">
						<?= $this->formUserProfile->email ?>
					</li>
					<li class="element-group">
						<?= $this->formUserProfile->language ?>
					</li>
					<li class="element-group">
						<?= $this->formUserProfile->submit ?>
					</li>
					<?= $this->formUserProfile->user_oid ?>
					<?= $this->formUserProfile->profile_oid ?>
					<?= $this->formUserProfile->isOpenID ?>
				</ul>
			</div>
		</form>
	</div>	